<template>
	<view>
		<uni-list>
			<uni-list-item v-for="(item, index) in shareCustomer" :key="index">
				<!-- 自定义 header -->
				<template v-slot:header>
					<view style="flex: 1; display: flex; align-items: center">
						<image style="width: 40px; height: 40px; border-radius: 20px"
							:src="item.cust?.ciAvat ? item.cust?.ciAvat: tempImageUrl" mode="widthFix">
						</image>
						<view style="margin-left: 8px; font-size: 13px">
							<view>{{ (item.cust?.ciName || '') + (item.cust?.ciAlia ? '(' + item.cust.ciAlia + ')' : '') }}</view>
							<view>{{ (item.cust?.ciPhon || '') }}</view>
						</view>
					</view>
				</template>
				<!-- 自定义 footer-->
				<template v-slot:footer>
					<view style="margin-top: 5px;">{{UTCTimeToLocal(item.clTime)}}</view>
				</template>
			</uni-list-item>
		</uni-list>
	</view>
</template>

<script>
	import {
		mapGetters
	} from "vuex";
	import {
		getCustomerRelationshipByOrUuid
	} from "../../utils/api.js"
	export default {
		data() {
			return {
				shareCustomer:[],
				tempImageUrl: "http://jdc.jd.com/img/100x100/",
			}
		},
		computed: {
			...mapGetters({
				activity: "activityInfo/activity",
			}),
		},
		onLoad(params) {
			if (params.orUuid) {
				this.loadStaffShareDetail({orUuid:params.orUuid, gpUuid: this.activity.gpUuid })
			}
		},
		methods: {
			async loadStaffShareDetail({orUuid, gpUuid}) {
				let res = await getCustomerRelationshipByOrUuid({
					orUuid,
					gpUuid,
				});
				if (res) this.shareCustomer = res
			}
		}
	}
</script>

<style>
</style>